﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using GCTrackableRace.Interfaces;
using System.Globalization;

namespace GcTrackableRace.ScoreCalculator.Rules
{
	public abstract class BaseRule
	{
		protected BaseRule(string reportColumnName, string startDate, string endDate, string pointAllocation)
		{
			ReportColumnName = reportColumnName;
			StartDate = DateTime.Parse(startDate);
			EndDate = DateTime.Parse(endDate);
			PointAllocation = decimal.Parse(pointAllocation);

			SetRuleName();
		}

		protected CultureInfo InvariantCulture { get { return CultureInfo.InvariantCulture; } }

		protected abstract void SetRuleName();

		public abstract void Process(ITrackable trackable, IEnumerable<ITrackableLog> trackableLogs);

		public decimal PointAllocation { get; private set; }

		public string ReportColumnName { get; private set; }

		public DateTime StartDate { get; private set; }

		public DateTime EndDate { get; private set; }

		public string RuleName { get; protected set; }
	}
}
